home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: Camelot
/
Camelot 098 (1990-12)(Swedish User Group of Amiga)(SE)(PD)[WB].zip
/
Camelot 098 (1990-12)(Swedish User Group of Amiga)(SE)(PD)[WB].adf
/
XLisp-Stat
/
Functions
/
randomgen.lsp
< prev
next >
Wrap
Lisp/Scheme
|
1990-10-11
|
192b
|
10 lines
; book pp.102-103
(defun make-generator (a m x0)
(let ((x x0))
#'(lambda ()
(setf x (rem (* a x) m))
(/ x m))))
(def g (make-generator (^ 7. 5) (- (^ 2. 31) 1) 12345))